<?php
   require_once('system/dbConnect.php');
   require_once('system/MyFunc.php');   
  connect();
  if(!empty($_FILES["pic"]["name"])){
    $pic = uploadfile('pic','upload/',array('jpg','gif','png'));
  }
  else{
    $pic='';
  }
$data = array(
    'videoname' => trim($_POST['videoname']),  
    'tid' => $_POST['tid'],
    'pic' => $pic,  
    'intro' => $_POST['intro'],
    'uploaddate' => $_POST['uploaddate'],
    'uploadadmin' => $_POST['uploadadmin'],
    'hittimes' => $_POST['hittimes'],
    'downtimes' => $_POST['downtimes'],
    );
  $result = add('videos',$data); 
  if(!$result){
    echo "失败添加！<br/>";
    echo "<a href='videoadd.php'>返回</a>";   
  }else{    
  echo "添加成功！";
  echo "请使用<a href='login.html'>管理员登录</a>查看用户信息，";
  echo "或返回<a href='videolist.php'>查看</a>页面！";   
  }    
  
?>
